@extends('admin.layouts.base')
@section('title','产品表现数据')
@section('pageHeader','产品表现数据')

@section('content')
    <div class="row">
        <div class="col-lg-12">
            {{--提示信息弹出框--}}
            @include('admin.partials.errors')
            @include('admin.partials.success')
            {{--提示信息弹出框--}}

            <div class="box box-success">
                {{--内容主体 开始--}}
                <div class="box-header">
                    <h1 class="box-title">市场表现数据</h1>
                </div>

                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active">
                        <a href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab" id="nav-tab-1">
                            昨天市场总览
                        </a>
                    </li>
                    <li role="presentation">
                        <a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab" id="nav-tab-2">
                            30天市场总览
                        </a>
                    </li>
                </ul>
                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="tab1">

                        {{--昨天产品总览 开始--}}
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-header">
                                    {{--<h3 class="box-title">昨天产品总览</h3>--}}

                                    {{--搜索框 开始--}}
                                    {{--<span style="float:right;margin-right:10%">
                                        搜索:&nbsp;&nbsp;
                                        <input type="text" name="productName" placeholder="产品名称"
                                               value="{{ Request::input('productName') }}"/>
                                        &nbsp;&nbsp;
                                        <input type="text" name="userphone" placeholder="所属平台"
                                               value="{{ Request::input('userphone') }}" max="11"/>
                                        &nbsp;&nbsp;
                                        <span onclick="search()" class="glyphicon glyphicon-search"></span>
                                    </span>--}}
                                    {{--搜索框 结束--}}

                                </div>

                                <div class="box-footer" style="overflow: hidden">

                                    <table id="records-table" class="table table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>市场名称</th>
                                            <th>昨天PV</th>
                                            <th>昨天UV</th>
                                            <th>昨天按钮点击次数</th>
                                            <th>昨天按钮点击人数</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>

                                        @foreach($yesterdayDatas as $key => $data)
                                            <tr>
                                                <td>{{ $key + 1 }}</td>
                                                <td>
                                                    <img src="{{ $data->product_logo }}" width="30" alt="logo">
                                                    {{ $data->platform_product_name }}
                                                </td>
                                                <td>{{ $data->platformname }}</td>
                                                <td>{{ $data->details_total }}</td>
                                                <td>{{ $data->details_user_total }}</td>
                                                <td>{{ $data->apply_total }}</td>
                                                <td>{{ $data->user_total }}</td>
                                                <td>
                                                    <a href="{{ '' }}" class="btn btn-info btn-xs">信息详情</a>
                                                </td>
                                            </tr>
                                        @endforeach

                                        </tbody>
                                    </table>

                                    {{--分页 开始--}}
                                    {{--<div class="pull-left">
                                        {!! $yesterdayDatas->render() !!}
                                    </div>--}}
                                    {{--分页 结束--}}

                                    {{--导出Excel 开始--}}
                                    <div class="pull-right">
                                <span style="display: inline-block;margin: 20px;">
                                    <button type="button" class="btn btn-warning btn-xs text-right">导出Excel</button>
                                </span>
                                    </div>
                                    {{--导出Excel 结束--}}

                                </div>
                            </div>
                        </div>
                        {{--昨天产品总览 结束--}}

                    </div>
                    <div role="tabpanel" class="tab-pane" id="tab2">

                        {{--30天产品总览 开始--}}
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-header">
                                    {{--<h3 class="box-title">30天产品总览</h3>--}}

                                    {{--搜索框 开始--}}
                                    {{--<span style="float:right;margin-right:10%">
                                        搜索:&nbsp;&nbsp;
                                        <input type="text" name="productName" placeholder="产品名称"
                                               value="{{ Request::input('productName') }}"/>
                                        &nbsp;&nbsp;
                                        <input type="text" name="userphone" placeholder="所属平台"
                                               value="{{ Request::input('userphone') }}" max="11"/>
                                        &nbsp;&nbsp;
                                        <span onclick="search()" class="glyphicon glyphicon-search"></span>
                                    </span>--}}
                                    {{--搜索框 结束--}}

                                </div>

                                <div class="box-footer" style="overflow: hidden">

                                    <table id="records-table" class="table table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>产品名称</th>
                                            <th>所属平台</th>
                                            <th>30天PV</th>
                                            <th>30天UV</th>
                                            <th>30天按钮点击次数</th>
                                            <th>30天按钮点击人数</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td>test</td>
                                            <td>test</td>
                                            <td>test</td>
                                            <td>test</td>
                                            <td>test</td>
                                            <td>test</td>
                                            <td>test</td>
                                            <td>
                                                <a href="{{ '' }}" class="btn btn-info btn-xs">信息详情</a>
                                            </td>
                                        </tr>

                                        @foreach($monthDatas as $key => $data)
                                            <tr>
                                                <td>{{ $key + 1 }}</td>
                                                <td>
                                                    <img src="{{ $data->product_logo }}" width="30" alt="logo">
                                                    {{ $data->platform_product_name }}
                                                </td>
                                                <td>{{ $data->platformname }}</td>
                                                <td>{{ $data->details_total }}</td>
                                                <td>{{ $data->details_user_total }}</td>
                                                <td>{{ $data->apply_total }}</td>
                                                <td>{{ $data->user_total }}</td>
                                                <td>
                                                    <a href="{{ '' }}" class="btn btn-info btn-xs">信息详情</a>
                                                </td>
                                            </tr>
                                        @endforeach

                                        </tbody>
                                    </table>

                                    {{--分页 开始--}}
                                    {{--<div class="pull-left">
                                        分页 TODO
                                    </div>--}}
                                    {{--分页 结束--}}

                                    {{--导出Excel 开始--}}
                                    <div class="pull-right">
                                <span style="display: inline-block;margin: 20px;">
                                    <button type="button" class="btn btn-warning btn-xs text-right">导出Excel</button>
                                </span>
                                    </div>
                                    {{--导出Excel 结束--}}

                                </div>
                            </div>
                        </div>
                        {{--30天产品总览 结束--}}

                    </div>
                </div>
            </div>
@endsection

@section('js')
    <script>
        setInterval(function () {
            $("#jg").fadeOut(1000);
        }, 3000);
        // 设置统一ajax请求参数:csrf_token
            /*$.ajaxSetup({
             headers: {
             'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
             }
             });*/

    </script>
@endsection
